<extend name="Public/base" />
<block name="body">
    <div class="main-title" style="padding-bottom: 10px;">
        <h2>演示报表</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <form method='POST' action="{:U('DemoExport')}" id="form-export">
                <input type="hidden" name="shopid" value="{$shopid}" />
                 <a class="btn btn-default" href="javascript:;" id="ExportSubmit">导出</a> {$name}{:get_sp_shop_name(3)}
            </form>
           
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <form action="{:U('SpReport/Demo')}" method='post' id="form-search">
                    <select name="shopid" class="search-input" >
                        <option value='-1'>全部商品分类</option>
                        <volist name="shoplist" id="vo">
                            <option value="{$vo.id}" <if condition="$vo.id eq $shopid">selected="selected"</if>>{$vo.name}</option>
                            
<!--                            <option value="{$vo.id}" <if condition="$vo.id eq $pCategoryId">selected="selected"</if>    <eq name="vo.type" value="2">style="background-color:#FFCCFF"</eq> <eq name="vo.isDisposal" value="1">style="background-color:#CCFFFF"</eq>><eq name="vo.type" value="2">-----</eq> {$vo.name} <eq name="vo.type" value="2">[进货商品分类]</eq> <eq name="vo.isDisposal" value="1">[处理品]</eq></option>	-->
                        </volist>
                    </select>
                    <input type="text" name="name" class="search-input" value="{:I('name')}" placeholder="请输入商品名称">
                    <a class="sch-btn" href="javascript:;" id="search"><i class="btn-search" id="submit"></i></a>
                </form>
            </div>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table>
            <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                    <th>序列号</th>
                    <th>店铺ID</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>总销售额</th>
                    <th>销售总数</th>
                    <th>总利润</th>
                    <th>充值总额</th>
                    <th>赠送金额</th>
                    <th>现金总额</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr> 
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td> 
                        <td>{$vo.overallNum} </td>
                        <td>{$vo.shopId|get_sp_shop_name} </td>
                        <td>{$vo.beginTime|time_format} </td>
                        <td>{$vo.endTime|time_format} </td>
                        <td>{$vo.totalAmount} </td>
                        <td>{$vo.totalCount} </td>
                        <td>{$vo.totalProfit} </td>
                        <td>{$vo.totalCharge} </td>
                        <td>{$vo.giveAmount} </td>
                        <td>{$vo.totalCash} </td>
                        <td>{$vo.status_text} </td>
                        <td>
                            <a href="{:U('SpProduct/edit')}&id={$vo['id']}" class="btn btn-primary">编辑</a>
                            <a href="{:U('SpProduct/changeStatus?id='.$vo['id'])}&method=delete" class="confirm ajax-get btn btn-warning">删除</a>

                            <eq name="vo.status" value="1">
                            <a href="{:U('SpProduct/changeStatus?id='.$vo['id'])}&method=forbid" class="confirm ajax-get btn btn-warning ">禁用</a>
                    <else/>
                    <a href="{:U('SpProduct/changeStatus?id='.$vo['id'])}&method=resume" class="confirm ajax-get btn btn-warning">启用</a>
                    </eq> 

                    </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="13" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
    </div>
</block>



<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        //搜索查询
        $('#submit').click(function () {
            document.getElementById("form-search").submit();
        }); 
        
        //订单导出 
        $('#ExportSubmit').click(function () {
            document.getElementById("form-export").submit();
        }); 
       
        //导航高亮
        highlight_subnav('{:U('SpProduct/Demo')}');
    </script>
</block>